<template>
	<view class="late">
		<Top :title='title'></Top>
		<view class="" style="font-size: 32rpx;color: white;width: ;">
			<bctos-rich-text :nodes="content" type='text'></bctos-rich-text>
		</view>
		<view class="pklm">
			<view class="chakan" @click="goDetails">查看活动套系</view>
		</view>
		<view class="pklm" style="opacity: 0;position: unset;">
			<view class="chakan">查看活动套系</view>
		</view>
	</view>
</template>

<script>
	import Top from '../../components/navBox/top.vue'
	export default {
		data() {
			return {
				title: '最新活动',
				content: '',
				id: 0,
				toid: 0,
			}
		},
		components: {
			Top
		},
		computed: {

		},
		onLoad(options) {
			this.id = options.id;
			this.getcontent();
		},
		mounted() {

		},
		methods: {
			goDetails() {
				if (this.toid == 0) {
					return;
				}
				uni.navigateTo({
					url: '/pages/filePages/goodsDetail/goodsDetail?id=' + this.toid + '&type=' + 1
				})
			},
			getcontent() {
				this.$request({
					url: 'channel/getChannelhdinfo',
					method: 'POST',
					data: {
						id: this.id
					}
				}).then(res => {
					if (res.data.code == 1) {
						this.title = res.data.data.title;
						this.content = res.data.data.content.replace(/\<img/gi, '<img class="diy-img" ')
						this.toid = res.data.data.toid;
					} else {
						uni.showToast({
							title: res.data.msg,
							icon: 'none',
							duration: 1000
						});
					}
				})
			}
		}
	}
</script>
<style>
	page{
		background: #111;
	}
</style>
<style scoped lang="scss">
	.late {
		width: 750upx;
	}
	
	.diy-img {
	    max-width: 100%;
	}

	.daimg {
		width: 100%;
		margin-top: 20upx;
	}

	.wentx {
		width: 686upx;
		margin: 0 auto;
		color: #999;
		font-size: 28upx;
		line-height: 48upx;
	}

	.pklm {
		height: 100upx;
		padding-top: 10upx;
		width: 100%;
		position: fixed;
		bottom: 0;
		left: 0;
		background: #111;
	}

	.chakan {
		width: 684upx;
		height: 80upx;
		background: linear-gradient(270deg, #B49C6E 0%, #ECD9AF 100%);
		border-radius: 40upx;
		text-align: center;
		line-height: 80upx;
		margin: 0 auto;
		color: #111;
		font-size: 28upx;
	}
</style>
